import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/items/labTaskAllot/getCheckItems',
  saveOrUpdate = '/items/labTaskAllot/saveOrUpdate',
  queryItemData = '/items/labTaskAllot/getItemsRecordData',
  devAndUteList = '/device/labDevice/queryDevAndUteList',
  userList = '/sys/user/list',
  handleUsers = '/items/labTaskAllot/handleUsers',
  auditCheckData = '/items/labTaskAllot/auditCheckData',
  getOne = '/items/labTaskAllot/getOne',
}

/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({ url: Api.list, params });

/**
 * 
 * @param params 查单个实验
 * @returns 
 */
export const getOne = (params) =>
  defHttp.get({ url: Api.getOne, params });

/**
* 用户列表
* @param params
*/
export const getUserList = (params) => {
  return defHttp.get({ url: Api.userList, params });
};

/**
 * 列表接口
 * @param params
 */
export const handleUsers = (params) =>
  defHttp.get({ url: Api.handleUsers, params });


/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params) => {
  let url = Api.saveOrUpdate;
  return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

/**
* @param params
*/
export const queryItemData = (params) => defHttp.get({ url: Api.queryItemData, params });

/**
 * 列表接口
 * @param params
 */
export const devAndUteList = (params) => defHttp.get({ url: Api.devAndUteList, params });


export const auditCheckData = (params) => {
  return defHttp.delete({ url: Api.auditCheckData, params }, { joinParamsToUrl: true });
}



// /**
//  * 删除单个
//  * @param params
//  * @param handleSuccess
//  */
// export const deleteOne = (params,handleSuccess) => {
//   return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
//     handleSuccess();
//   });





